<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ice="http://www.icesoft.com/icefaces/component"
>
    
    <body>
        
        <ui:composition template="./TemplateLogin.xhtml">
            
            <ui:define name="title">

            </ui:define>

            <ui:define name="body">
                <ice:panelGroup id="messagePanel" styleClass="jsfCenter" layout="block"  >
                    <ice:messages errorClass="errorMessages" globalOnly="true" infoClass="infoMessages" layout="table" />
                </ice:panelGroup>
                <fieldset class="form">
                    <legend class="form">Bienvenido</legend>
                    <ice:form id="loginform" partialSubmit="true">
                        <ice:panelGrid styleClass="loginPG" headerClass="loginPG_header" rowClasses="tituloLateral" footerClass="loginPG_footer" rules="rows" id="login" columns="5" cellpadding="2" cellspacing="0">

                            <f:facet name="header">
                                <ice:outputText value="Login" />
                            </f:facet>
                            <ice:outputText style="color:black;" value="RUT:"/>
                            <ice:inputText id="rut" maxlength="8" validatorMessage="*" required="true" requiredMessage="*" validator="#{usuario.validateRut}" value="#{usuario.usuario.rut}"/>

                            <ice:message errorClass="errorMessages" for="rut"/>

                            <ice:inputText id="digito" validatorMessage="*" validator="#{usuario.validateDigito}" size="2" maxlength="1" required="true" style="text-transform:uppercase" requiredMessage="*" value="#{usuario.usuario.digito}" />

                            <ice:message errorClass="errorMessages" for="digito" />
                            <ice:outputText style="color:black;" value="Clave:" />
                            <ice:inputSecret maxlength="20" id="clave" required="true" requiredMessage="*" value="#{usuario.usuario.clave}" title="Clave" redisplay="true" action="#{usuario.login}"/>
                            <ice:message errorClass="errorMessages" for="clave" />
                            <ice:inputHidden />
                            <ice:inputHidden />
                            <f:facet name="footer">
                                <ice:commandButton value="OK" action="#{usuario.login}" />
                            </f:facet>
                        </ice:panelGrid>
                    </ice:form>
                </fieldset>
            </ui:define>

        </ui:composition>
        
    </body>
</html>
